package com.web;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;

import com.data.hibernate.MenuDAO;

@Controller
public class MainController {
	
	@Autowired
	private MenuDAO menuDao;
	
	@RequestMapping
	public ModelAndView mainHandler()
	{
		return new ModelAndView("main","data", menuDao
				.getHibernateTemplate().find(
				"from Menu where parentId is null"));
	}
}
